package main

import (
	"os"
	"io/ioutil"
	"fmt"
	"strings"
	"log"
	"reflect"
)

func main() {
	files := os.Args[1:]
	counts := make(map[string]int)

	for _,arg := range files {
		data,err := ioutil.ReadFile(arg)
		if err != nil {
			fmt.Printf("读取文件出错%s",err)
		}
		log.Println(reflect.TypeOf(data))
		log.Println(string(data))
		fs := strings.Split(string(data),"\n")
		for _,lines := range fs {
			counts[lines]++
		}
	}

	for k,v :=range counts {
		fmt.Println(k,"--",v)
	}

}
